package com.example.mapper;

import com.example.entity.Account;
import com.example.entity.Package;
import com.example.entity.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {

    List<User> selectUser(User user);

    void insert(User user);

    @Select("select * from `user` where username = #{username}")
    User selectByUsername(String username);

    void updateById(User addUser);

    @Update("update `user` set del_flag = 1 where id = #{id}")
    void deleteById(Integer id);

    @Select("select * from `user` where id = #{id}")
    User selectById(String id);

    @Select("SELECT COUNT(*) FROM user WHERE del_flag = 0")
    int selectUserTotal();
}
